<template>
    <div v-transfer-dom>
      <x-dialog :show.sync="showBind" class="dialog-demo bind-dialog">
        <div  class="bind-bg">
          <p class="btn" @click.passive="toBind"></p>
        </div>
        <!-- <div @click="showBind=false">
          <span class="vux-close"></span>
        </div> -->
      </x-dialog>
    </div>
</template>
<script>
import { XDialog, TransferDomDirective as TransferDom } from 'vux'
import {  getServerHost,
  preventMove,
  GetRequest,
  checkMobile,
  checkQq} from '@/assets/lib/tool.js'
export default {
  directives: {
    TransferDom
  },
  components: { XDialog },
  props: {
    bind: {
      type: Number,
      required: true
    }
  },
  data() {
    return {
      openid: GetRequest().openid,
      showBind: !Boolean(this.bind),
      judgeUrl: '/wxjx/goddess/common/user/judge'
    }
  },
  methods: {
    toBind() {
      var cburl = encodeURIComponent(location.href);
      var weixinId = 'gh_a1d4f56be7af';
      var bangdingUrl = "http://weixin.unisk.cn/weixinVipController.do?bindingMobile&weixinid=" + weixinId + "&openid=" + this.openid + "&cburl=" + encodeURI(cburl);
      window.location.href = bangdingUrl;
    }
  }
}
</script>
<style lang="less" scoped>
.bind-bg {
  margin: 0 auto;
  width: 509px;
  height: 279px;
  background: url("../../assets/img/bindphone.png") no-repeat;
  background-size: 509px 279px;
  display: flex;
  flex-direction: column;
  align-self: center;
  justify-content: center;
  .btn {
    margin: 110px auto 0;
    width: 256px;
    height: 56px;
  }
}
</style>
